import 'package:flutter/material.dart';
import 'package:full_display/common/qxp_style.dart';
import 'package:full_display/unit/asset_utils/asset_utils.dart';
import 'package:full_display/unit/screen/screen_utility.dart';

class ButtonWidget extends StatelessWidget {
  final String title;
  final String imgName;
  final int index;
  double iconWidth = 32.0.W;
  double iconHeight = 32.0.W;
  Function(int) tapAction;
  ButtonWidget(
      {Key? key,
      required this.title,
      required this.imgName,
      required this.index,
      required this.tapAction,
      required this.iconWidth,
      required this.iconHeight})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        tapAction(index);
      },
      child: Container(
        width: 32.0.W,
        height: 60.0.H,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              width: iconWidth,
              height: iconHeight,
              child: Image.asset(AssetUtils.getAsset2Image(imgName)),
            ),
            Container(
              margin: const EdgeInsets.only(top: 10),
              child: Text(
                title,
                style: StandardTextStyle.textWhite12Style,
              ),
            )
          ],
        ),
      ),
    );
  }
}
